package com.mryin.performance.controller;


import com.mryin.performance.mapper.TaskMapper;
import com.mryin.performance.mapper.UserMapper;
import com.mryin.performance.pojo.User;
import com.mryin.performance.utils.PerformanceUtils;
import com.mryin.performance.utils.ValueComparator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author MRYIN
 * @since 2021-03-02
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @Autowired
    private TaskMapper taskMapper;

    @RequestMapping("/valueComparatorBySurplusValue/{name}")
    public Integer valueComparatorBySurplusValue(@PathVariable("name") String name){
        return PerformanceUtils.valueComparatorBySurplusValue(name, userMapper, 0, 0, taskMapper);
    }

    @RequestMapping("/valueComparatorByInCome/{name}")
    public Integer valueComparatorByInCome(@PathVariable("name") String name){
        return PerformanceUtils.valueComparatorByInCome(name,userMapper,0,taskMapper);
    }
}
